<template>
  <div class="component_container">
    {{ currentData }}
  </div>
</template>

<script>
export default {
  name: 'Dmeo1',
  props: {
    currentData: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {

    }
  },
  watch: {
    currentData(newValue, oldValue) {
      if (newValue) {
        this.getList()
      }
    }
  },
  methods: {
    currentClick() {
      this.$message.success('点击了', JSON.stringify(this.currentData))
      this.$emit('currentClick', this.currentData)
    },
    getList() {
      // 模拟api请求
      this.currentData.name = '新增了api请求字段'
    }
  }
}
</script>

<style lang="scss" scoped>
.component_container{
    width: 300px;
    height: 300px;
    background: red;
}
</style>>

